package com.ljy.mapper;

import com.ljy.entity.LeaseSpec;
import com.ljy.entity.Specification;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface LeaseSpecMapper {
    void insert(List<LeaseSpec> specs,Integer leaseId);

    @Delete("delete from lease_spec where lease_id=#{leaseId}")
    void deleteByLeaseId(Integer leaseId);

    void batchDelete(List<Integer> ids);

    @Select("select id,lease_time , price,time from lease_spec " +
            "where lease_id=#{leaseId}")
    List<LeaseSpec> selectByLeaseId(Integer leaseId);

    @Select("select id, lease_time, price, time, lease_id from lease_spec where id=#{specId}")
    LeaseSpec selectBySpecId(Integer specId);
}
